# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pacumen
pkgver=1.92a0884
pkgrel=7
groups=('blackarch' 'blackarch-crypto' 'blackarch-networking')
pkgdesc='Packet Acumen - Analyse encrypted network traffic and more (side-channel attacks).'
arch=('any')
url='https://github.com/bniemczyk/pacumen'
license=('custom:unknown')
depends=('python2' 'python2-scipy' 'python2-numpy' 'python2-scapy'
         'python2-symath' 'python2-pydot' 'python2-pyqt5')
makedepends=('git' 'python2-setuptools')
source=("git+https://github.com/bniemczyk/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/python2' pacumen_timeseries.py
}

package() {
  cd $pkgname

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md TODO.md \
    paper/pacumen.pdf
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

